package com.sharing.domain;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.awt.dnd.InvalidDnDOperationException;
import java.time.LocalDateTime;
import java.util.Collection;

/**
 * @author MingTian
 * @version 1.0
 * @description TODO
 * @date 2023/4/1 22:57
 */
@Data
public class User {
    /**
     * 用户id
     */
    private Integer id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 性别
     */
    private String gender;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 密码
     */
    private String password;

    /**
     * 城市
     */
    private String city;

    /**
     * 用户身份：管理用户、普通用户
     */
    private String identity;

    /**
     * 创建日期
     */
    private String createDate;

    /**
     * 修改日期
     */
    private String updateDate;

    public User() {
    }

    public User(Integer id) {
        this.id = id;
    }

    public User(Integer id, String userName, String phone, String gender, Integer age, String password, String city, String identity) {
        this.id = id;
        this.userName = userName;
        this.phone = phone;
        this.gender = gender;
        this.age = age;
        this.password = password;
        this.city = city;
        this.identity = identity;
    }

    public User(Integer id, String userName, String phone, String gender, Integer age, String password, String city, String identity, String createDate, String updateDate) {
        this.id = id;
        this.userName = userName;
        this.phone = phone;
        this.gender = gender;
        this.age = age;
        this.password = password;
        this.city = city;
        this.identity = identity;
        this.createDate = createDate;
        this.updateDate = updateDate;
    }

    public String toString() {
        return "User{id=" + id
                + ", userName=" + userName
                + ", phone=" + phone
                + ", gender=" + gender
                + ", age=" + age
                + ", password=" + password
                + ", city=" + city
                + ", identity=" + identity
                + ", create_date=" + createDate
                + ", update_date=" + updateDate
                + "}";
    }
}
